<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title th:text="${title}+'-'+${@config.getKey('site.name')}"></title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}"/>
    <link rel="stylesheet" th:href="@{/css/css.css}"/>
</head>
<script type='text/javascript'>
    (function(m, ei, q, i, a, j, s) {
        m[i] = m[i] || function() {
            (m[i].a = m[i].a || []).push(arguments)
        };
        j = ei.createElement(q),
            s = ei.getElementsByTagName(q)[0];
        j.async = true;
        j.charset = 'UTF-8';
        j.src = 'https://static.meiqia.com/dist/meiqia.js?_=t';
        s.parentNode.insertBefore(j, s);
    })(window, document, 'script', '_MEIQIA');
    _MEIQIA('entId', 163871);
</script>
<body>

<!--广告区域-->
<div class="christmas_ad" style="width:155px; height:220px; position:absolute; top:250px; right:25px;">
    <span th:utext="${newOneAD.getNoticeContent()}"></span>
</div>

<div class="w1170" th:include="common/head::#h" style="padding-bottom: 10px;overflow:visible;"></div>

<!--通知区域-->
<div class="w1170">
    <div align="left" style="padding-top: 0px;padding-bottom: 10px;">
        <marquee><span th:utext="${newOne.getNoticeContent()}"></span></marquee>
    </div>
</div>

<!--检索区域-->
<div class="w1170">

    <div class="pLeft">

        <div class="data_list">
            <div class="data_list_title">
                <i class="layui-icon layui-icon-search"></i>
                <span class="head">条件检索</span>
            </div>
            <div class="data_search">
                <div>
                    <table>
                        <tr>
                            <td width="80px" style="padding-top: 0px;padding-bottom: 28px;"><font
                                    class="stitle">资源类别：</font></td>
                            <td>
                                <ul>
                                    <li><a href="/"><span id="t_0">全部</span></a></li>
                                    <li th:each="arcType:${allArcTypeList}">
                                        <a th:href="'/article/list/1?typeId='+${arcType.srcTypeId}" th:title="'已有资源数：'+${arcType.allSize}">
                                            <span th:id="'t_'+${arcType.srcTypeId}" th:text="${arcType.srcTypeName}"></span>
                                        </a>
                                    </li>
                                </ul>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                        </tr>
                        <tr style="border-top: dashed 1px #e6e6e6;height: 60px;">
                            <td width="80px" style="padding-top: 0px;"><font class="stitle">关键词：</font></td>
                            <td>
                                <form action="/article/search" onsubmit="return submitData()">
                                    <div class="layui-row">
                                        <div class="layui-col-md10">
                                            <input type="text" id="q" name="q" autocomplete="off" class="layui-input"
                                                   style="height: 30px"/>
                                        </div>
                                        <div class="layui-col-md2">
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit"
                                                                                       class="layui-btn layui-btn-radius layui-btn-sm"
                                                                                       value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;搜索&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "/>
                                        </div>
                                    </div>
                                </form>
                            </td>
                        </tr>
                    </table>
                </div>
                <div>
                </div>
            </div>
        </div>


        <div class="data_list">
            <div class="data_list_title">
                <i class="layui-icon layui-icon-template-1"></i>
                <span class="head">资源列表</span>
            </div>
            <div class="layui-form">
                <table class="layui-table" lay-skin="line">
                    <colgroup>
                        <col/>
                        <col width="100"/>
                        <col width="80"/>
                        <col width="120"/>
                        <col width="80"/>
                    </colgroup>
                    <thead>
                    <tr>
                        <th>资源名称</th>
                        <th>查看次数</th>
                        <th>上传者</th>
                        <th>上传日期</th>
                        <th>积分</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="article:${articleList}">
                        <td><a target="_blank" th:href="'/article/detail/'+${article.articleId}" th:title="${article.articleName}"
                               th:text="${#strings.length(article.articleName)>30} ? ${#strings.substring(article.articleName,0,31)} : ${article.articleName}"></a>
                        </td>
                        <td th:text="${article.articleView}"></td>
                        <td th:text="${article.user.loginName}"></td>
                        <td th:text="${#dates.format(article.articlePublishDate,'yyyy-MM-dd')}"></td>
                        <td th:text="${article.articlePoints}">1</td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div align="center" th:utext="${pageCode}"></div>
        </div>

    </div>

    <div class="pRight">

        <div class="data_list">
            <div class="data_list_title">
                <i class="layui-icon layui-icon-face-smile-fine"></i>
                <span class="head">每日签到，每日领取3个积分</span>
            </div>
            <div align="center">
                <a onclick="sign()" th:if="${session.currentUser == null or !session.currentUser.isSign()}"><img
                        style="padding-top: 10px;padding-bottom: 10px" width="200" height="50" alt="用户签到处"
                        src="/img/sign.jpg"/></a>
                <div th:if="${session.currentUser!=null and session.currentUser.isSign()}"
                     style="padding-top: 10px;padding-bottom: 10px">
                    您今天第<font color="red" th:text="${session.currentUser.signSort}"></font>个签到成功；<br/>
                    签到时间:<font th:text="${#dates.format(session.currentUser.signTime,'HH时mm分ss秒')}"></font>
                </div>

                <p style="padding-bottom: 10px">今日已经有<font color="red" th:text="${signTotal}"></font>位会员签到了！
                </p>
            </div>
        </div>

        <div class="data_list">
            <div class="data_list_title">
                <i class="layui-icon layui-icon-fire"></i>
                <span class="head">热门资源</span>
            </div>
            <div class="datas">
                <ul>
                    <li th:each="hotArticle:${hotArticleList}">
                        <a target="_blank" th:href="'/article/detail/'+${hotArticle.articleId}" th:title="${hotArticle.articleName}"
                           th:text="${#strings.length(hotArticle.articleName)>20} ? ${#strings.substring(hotArticle.articleName,0,21)} : ${hotArticle.articleName}"></a>
                    </li>
                </ul>
            </div>
        </div>

    </div>

</div>


<div class="w1170" th:include="common/link::#h"></div>

<div class="w1170" th:include="common/foot::#h" style="padding-top: 40px"></div>

<script th:src="@{/layui/layui.js}" type="text/javascript"></script>
<script th:src="@{/js/jquery.js}" type="text/javascript"></script>
<script th:src="@{/js/common.js}" type="text/javascript"></script>
<script th:inline="javascript">
    /*<![CDATA[*/
    layui.use(['element', 'form', 'laypage'], function () {
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
        var tMenu = [[${session.tMenu}]];
        $("#" + tMenu).css("color", "red");
        $("#index").addClass("layui-this");
    });

    /*]]>*/

    $(function(){
        $(window).scroll(function(){
            var scrollTop = document.body.scrollTop || document.documentElement.scrollTop || 0;
            $(".christmas_ad").stop();
            var scrollTop2 = (scrollTop+160) - $(".christmas_ad").position().top;
            if(scrollTop> 440){
                $(".christmas_ad:not(:animated)").animate({top:"+="+scrollTop2+"px"},1000);
            }else{
                $(".christmas_ad").css("top",370+"px");
            }
        })
    })
</script>
</body>
</html>